package cl.regalloc.parse;

/**
 * StackLocation class implementing stack locations of form 0xXXXX($reg)
 * @author andyli
 *
 */

public class StackLocation implements Operand {

	private Integer offset;
	private Register sp;

	public StackLocation(Integer offset, Register sp) {
		this.offset = offset;
		this.sp = sp;
	}

	public String toString() {
		/* return in 0xXXXX($REG) format */
		return (Integer.toHexString(this.offset) + "(" + sp.toString() + ")");
	}
}